
<%@page import="java.util.List"%>
<%@page import="database.DBClass"%>
<%@page import="model.PegawaiBean"%>
<%@ include file="header.jsp"%>
<% PegawaiBean bean = new PegawaiBean();
    //get request from servlet if data is invalid

    if (request.getAttribute("updateuser") != null) {
        bean = (PegawaiBean) request.getAttribute("updateuser");
    }
%>

<!-- start: Content -->
<div id="content" class="span10">


    <ul class="breadcrumb">
        <li>
            <i class="icon-home"></i>
            <a href="index.html">Home</a>
            <i class="icon-angle-right"></i> 
        </li>
        <li>
            <i class="icon-edit"></i>
            <a href="#">Forms</a>
        </li>
    </ul>



    <div class="row-fluid sortable">
        <div class="box span12">
            <div class="box-header" data-original-title>
                <h2><i class="halflings-icon edit"></i><span class="break"></span>Form Pegawai</h2>

            </div>
            <div class="box-content">
                <form class="form-horizontal" method="post" action="ControllerServlet">
                    <fieldset>
                      
                        <div class="control-group success">

                            <div class="controls">
                                <input class="input-xlarge" type="hidden" id="id" name="id" value="<%=bean.getPegawaiId()%>" <%=request.getAttribute("updateuser") != null ? "readonly" : ""%> >

                            </div>
                        </div>

                       
                        <div class="control-group success">
                            <!--                            <label class="control-label" for="username"></label>-->
                            <div class="controls">
                                <input class="input-xlarge" type="<%=request.getAttribute("updateuser") != null ? "hidden" : "text"%>" id="username" name="username" value="<%=(bean.getUsername())%>" placeholder="Username">

                            </div>
                        </div>
                        <div class="control-group success">
                            <label class="control-label" for="nama">Nama:</label>
                            <div class="controls">
                                <input class="input-xlarge" type="text" id="nama" data-validation="required" data-validation-error-msg="Nama harus diisi" name="nama" value="<%=(bean.getNama())%>">

                            </div>
                        </div>
                        <div class="control-group success">
                            <label class="control-label" for="password" >Password:</label>
                            <div class="controls">
                                <input class="input-xlarge" data-validation="required strength" data-validation-strength="2" data-validation-error-msg="Password anda kurang rumit" type="<%=request.getAttribute("updateuser") != null ? "hidden" : "password"%>" id="password" name="password" >

                            </div>
                        </div>
                        <div class="control-group success">
                            <label class="control-label"  for="bagian">Bagian:</label>
                            <div class="controls">
                                <select id="bagian" name="bagian" data-rel="chosen" data-validation="required" data-validation-error-msg="Bagian harus dipilih">
                                    <option value="<%=(bean.getIdBagian())%>"><%=(bean.getNamaBagian())%></option>
                                    <option value="1">Bagian SDM</option>
                                    <option value="2">Bagian Produksi</option>
                                    <option value="3">Bagian Penjualan</option>
                                    <option value="4">Bagian Keuangan</option>

                                </select>
                            </div>
                        </div>
                        <div class="control-group success">
                            <label class="control-label" for="alamat">Alamat:</label>
                            <div class="controls">
                                <input class="input-xlarge" type="text" data-validation="required" data-validation-error-msg="Alamat harus diisi" id="alamat" name="alamat" value="<%=(bean.getAlamat())%>">
                            </div>
                        </div>
                        <div class="control-group success">
                            <label class="control-label" for="telepon">Telepon</label>
                            <div class="controls">
                                <input class="input-xlarge" type="text" data-validation="required number" data-validation-length="12" data-validation-error-msg="Nomor telepon harus diisi dengan 12 digit angka" id="telepon" name="telepon" value="<%=(bean.getTelp())%>">
                                
                            </div>
                        </div>
                        <div class="control-group success">
                            <label class="control-label" for="gaji">Gaji:</label>
                            <div class="controls">
                                <select id="gaji" name="gaji" data-rel="chosen" data-validation="required" data-validation-error-msg="Gaji harus dipilih">
                                    <option value="<%=(bean.getIdGolongan())%>"><%=(bean.getGajiPegawai())%></option>
                                    <option value="1">2500000</option>
                                    <option value="2">3500000</option>
                                    <option value="3">4500000</option>
                                    

                                </select>
                            </div>
                        </div>
                        <div class="form-actions">
                            <button type="submit" class="btn btn-primary" name="action" value="<%=(bean.getAction())%>"><%=(bean.getAction())%></button>

                        </div>
                    </fieldset>
                </form>

            </div>
        </div><!--/span-->

    </div><!--/row-->




</div><!--/.fluid-container-->

<!-- end: Content -->
</div><!--/#content.span10-->
</div><!--/fluid-row-->

<%@ include file="footer.jsp"%>